package cn.tac.framework.core.pojo;

import java.util.ArrayList;
import java.util.List;

/**
 * 定义装配器（主要负责dto与bo之间的转换工作）接口
 *
 * @author : tac
 * @since : 2017/7/14
 */
public abstract class Assembler<FROM, TO> {
    public abstract TO assemble(FROM from);
    public List<TO> assemble(List<FROM> fromList){
        List<TO> toList = new ArrayList<>();
        fromList.forEach(from -> toList.add(assemble(from)));
        return toList;
    }
}